import $http from '@/assets/js/http'

//公用列表 活动、动态、心情、求购、供应、二手
//dataType   具体类型：如果是查询动态，7种类型：1企业动态、2本地新闻、3协会动态、4政策动态、5本地人物、6企业访谈、7评析；如果是查询心情，3种类型：1摄影园地，2随笔，3诗歌散文；其他类型查询和查询全部传：0
export function getFenzhanPublicList(para) {
    return $http.get('/manage/fenzhan/public/list', {
        params: {
            type: para.type,
            cityId: para.cityId,
            isChecked: para.isChecked,
            title: para.title,
            dataType: para.dataType,
            pageIndex: para.pageIndex,
            pageSize: para.pageSize
        }
    });
}
//查询详情 活动、动态、心情、求购、供应、二手
export function getFenzhanActivityDetail(type, objectId) {
    return $http.get('/manage/fenzhan/public/detail', {
        params: { type: type, objectId: objectId }
    });
}
//删除   公用删除-活动、动态、心情、求购、供应、二手
export function postFenzhanActivityDelete(type, objectId) {
    return $http.post('/manage/fenzhan/public/delete', {
        type: type,
        objectId: objectId
    });
}

//审核   公用审核审核的对象类型：3心情、4求购、5供应、6二手
export function postFenzhanPblicCheck(type, objectId, isPass) {
    return $http.post('/manage/fenzhan/public/check', {
        type: type,
        objectId: objectId,
        isPass: isPass
    });
}

//发布 编辑  活动
export function postFenzhanActivitySave(para) {
    return $http.post('/manage/fenzhan/activity/save', {
        id: para.id,
        cityId: para.cityId,
        title: para.title,
        headImg: para.headImg,
        content: para.content,
        keywords: para.keywords
    });
}
//发布 编辑  动态
export function postFenzhanDynamicSave(para) {
    return $http.post('/manage/fenzhan/dynamic/save', {
        id: para.id,
        type: para.type,
        cityId: para.cityId,
        title: para.title,
        headImg: para.headImg,
        content: para.content,
        source: para.source,
        keywords: para.keywords

    });
}

//修改分站城市信息
export function postFenzhanCityUpdate(para) {
    return $http.post('/manage/fenzhan/city/update', {
        cityId: para.cityId,
        contact: para.contact,
        address: para.address,
        longitude: para.longitude,
        latitude: para.latitude,
        email:para.email,
    });
}
//查询分站城市信息
export function getFenzhanCityInfo(cityId) {
    return $http.get('/manage/fenzhan/city/info', {
        params: { cityId: cityId }
    });
}